<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>

<link rel="stylesheet" type="text/css" href="js/bootstarp-3.3.7/css/bootstrap.min.css" />
	<script src="js/jquery-3.2.0.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/bootstarp-3.3.7/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" type="text/css" href="js/bootstarp-table-1.11.1/bootstrap-table.min.css" />
	<script src="js/bootstarp-table-1.11.1/bootstrap-table.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/bootstarp-table-1.11.1/bootstrap-table-zh-CN.min.js" type="text/javascript" charset="utf-8"></script>
		
		
		
    <script type="text/javascript">
    $(function() {
    	$("#tab").bootstrapTable({
    		url:"shgl/cx.lgg",
			pagination:true,
			pageSize:5, 
			queryParams:queryParam,
            columns:[{	
				field:'rcpt_id',
				title:'收货单号',
			    align:'center'
			},{
				field:'plan_receipt_date',
				title:'预计入库时间',
			    align:'center'
			},{
				field:'status_id',
				title:'状态',
			    align:'center'
			},{
				field:'rcpt_id',
				title:'入库确认',
			    align:'center',
			     formatter:function (value,row,index) {
						return"<button class='btn btn-danger glyphicon glyphicon-check' onclick='rkqr("+row.rcpt_id+")'></button>"
				    }
			}
			]
    	})
    	
    	
    	 
    	    	
   	  

    	
    	
    })
    
    	function queryParam(){
			return{
			 'wh_id':$("#name").val(), 
			
			}
			
		}
    	
    function rkqr(rcpt_id){
    	  
      $.ajax({
    		type:"post",
    		url:"shgl/upzt.lgg",
    		data:"rcpt_id="+rcpt_id,
    		success:function (data) { 
    		/* 	$("#tab").bootstrapTable("refresh"); */
    		}
    	});
      $("#mModal").modal('show');
      $("#tab2").bootstrapTable('destroy');
      $("#tab2").bootstrapTable({ 
			url:"shgl/yrk.lgg",
			pagination:true,
			pageSize:10, 
			queryParams:"rcpt_id="+rcpt_id,				
			columns:[{
				field:'prod_id',
				title:'货物编号',
			    align:'center'
			},{
				field:'pname', 
				title:'货物名称',
			    align:'center'
			},{
				field:'pcode',
				title:'货物编码',
			    align:'center'
			},{
				field:'ptype',
				title:'货物型号',
			    align:'center'
			},{
				field:'package_name',
				title:'包装单位',
				align:'center'
			},{
				field:'lostcount',
				title:'存放数量',
				align:'center'
			},{
				field:'done_flag',
				title:'出库确认',
				align:'center'
			}
			/* ,{
				title:'操作',
			    align:'center',
			    formatter:function (value,row,index) {
					return"<button class='btn btn-warning glyphicon glyphicon-check'  onclick='sel()'></button>"
			    }
			} */
			]
		}) 
    }
    
       
    
    
    
    </script>

</head>
<body>
	
	
	 <div class="modal fade bs-example-modal-lg" id="mModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
     <div class="modal-dialog modal-lg" role="document" style="width:1200px">
     <div class="modal-content">
     	<div class="modal-header">
			<h4>入库确认</h4>			
		</div>
     	
     	
            <div class="modal-body">
					<table id="tab2"></table>	 
			</div>
			
			<div class="modal-footer ">
						<button type="button" class="btn btn-danger glyphicon glyphicon-remove" data-dismiss="modal"></button>
						<button type="button" class="btn btn-success glyphicon glyphicon-ok" ></button>
					</div>
    </div>
  </div>
</div>
	
<table id="tab"></table>

</body>
</html>